<template>
  <el-card class="box-card">
    <el-row>
      <el-col :span="12">
        说明
      </el-col>

      <el-col :span="12">
        公告
        
      </el-col>
    </el-row>
    <el-row >
      <div id="statistics" style=" height:400px;"></div>
    </el-row>
  </el-card>
</template>

<script>
export default {
  data() {
    return {};
  },
  methods: {
    statistics() {
      var chartDom = document.getElementById("statistics");
      var myChart = this.$echarts.init(chartDom);
      var option;

      option = {
        title: {
          text: "挂号情况"
        },
        tooltip: {
          trigger: "axis",
          axisPointer: {
            type: "cross",
            label: {
              backgroundColor: "#6a7985"
            }
          }
        },
        legend: {
          data: ["预约人数", "就诊人数", "出院人数"]
        },
        toolbox: {
          feature: {
            saveAsImage: {}
          }
        },
        grid: {
          left: "3%",
          right: "4%",
          bottom: "3%",
          containLabel: true
        },
        xAxis: [
          {
            type: "category",
            boundaryGap: false,
            data: ["2022-04-15", "2022-04-16", "2022-04-17", "2022-04-18", "2022-04-19", "前天", "昨天"]
          }
        ],
        yAxis: [
          {
            type: "value"
          }
        ],
        series: [
          {
            name: "出院人数",
            type: "line",
            stack: "Total",
            areaStyle: {},
            emphasis: {
              focus: "series"
            },
            data: [150, 232, 201, 154, 190, 330, 410]
          },
          {
            name: "就诊人数",
            type: "line",
            stack: "Total",
            areaStyle: {},
            emphasis: {
              focus: "series"
            },
            data: [320, 332, 301, 334, 390, 330, 320]
          },
          {
            name: "预约人数",
            type: "line",
            stack: "Total",
            label: {
              show: true,
              position: "top"
            },
            areaStyle: {},
            emphasis: {
              focus: "series"
            },
            data: [820, 932, 901, 934, 1290, 1330, 1320]
          }
        ]
      };
      // 使用刚指定的配置项和数据显示图表。
      myChart.setOption(option);
    }
  },
  mounted() {
    this.statistics();
  }
};
</script>

<style scoped>
.text {
  font-size: 14px;
}

.item {
  padding: 18px 0;
}

.box-card {
  width: 100%;
  height: 100%;
}
</style>
